﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Tum.CollabXT.VModellXT.Tailoring
{
    /// <summary>
    /// This class contains all logic for performing the tailoring.
    /// </summary>
    public class TailoringBuilder
    {
        /// <summary>
        /// Project name.
        /// </summary>
        public string ProjName
        {
            get;
            set;
        }

        /// <summary>
        /// Model the tailoring is based on.
        /// </summary>
        public readonly VModellXT Model;

        /// <summary>
        /// Project type chosen for this tailoring.
        /// </summary>
        public ProjectType ProjType
        {
            get;
            set;
        }

        /// <summary>
        /// Project type variant chosen for this tailoring.
        /// </summary>
        public ProjectTypeVariant ProjTypeVariant
        {
            get;
            set;
        }

        /// <summary>
        /// Project characteristics and their belonging values set for this tailoring.
        /// </summary>
        public readonly Dictionary<ProjectCharacteristic, ProjectCharacteristicValue> ProjCharacteristics;


        /// <summary>
        /// Constructor
        /// </summary>
        public TailoringBuilder(VModellXT model)
        {
            if (model == null)
                throw new ArgumentNullException("model");
            Model = model;

            ProjCharacteristics = new Dictionary<ProjectCharacteristic, ProjectCharacteristicValue>();
        }

        /// <summary>
        /// Uses the provided data and creates the process tailoring.
        /// </summary>
        /// <returns>Process tailoring based on the provided data.</returns>
        public Tailoring BuildTailoring()
        {
            return Tailoring.Build(this);
        }
    }
}
